#ifndef AVALON_DATAGRAMPACKET_HPP
#define AVALON_DATAGRAMPACKET_HPP
#include "Avalon/IO/Buffer.hpp"
#include "Avalon/Network/Network.hpp"

namespace Avalon {
namespace Network {

  /*! \class DatagramPacket
   *  \brief Stores a single datagram packet.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class DatagramPacket {
    public:

      //! Constructs a DatagramPacket.
      DatagramPacket();

      //! Constructs a DatagramPacket.
      /*!
        \param size The size of the data.
        \param data The data stored by the packet.
        \param address The address that this packet was received from.
      */
      DatagramPacket(int size, const IO::Buffer& data,
        const IpAddress& address);

      //! Returns the size of this packet.
      int GetSize() const;

      //! Returns the data stored by this packet.
      const IO::Buffer& GetData() const;

      //! Returns the address that this packet was received from.
      const IpAddress& GetAddress() const;

    private:
      int m_size;
      IO::Buffer m_data;
      IpAddress m_address;
  };
}
}

#endif // AVALON_DATAGRAMPACKET_HPP
